﻿Namespace EIBData.DPT
    Public NotInheritable Class EIBDataDPT_3_007
        Inherits EIBDataDPT_3_Base

        Public Enum EIBDataDPT_3_007_Directions As Byte
            Decrease = 0
            Increase = 1
        End Enum

        Private _direction As EIBDataDPT_3_007_Directions = Nothing


        Sub New(data As Byte())
            MyBase.New(data)

            _direction = _directionBase
        End Sub

        Sub New(direction As EIBDataDPT_3_007_Directions, stepCode As Byte)
            MyBase.New(direction, stepCode)
        End Sub


        Public Shared Shadows ReadOnly Property DPT_Name As String
            Get
                Return "DPT_Control_Dimming"
            End Get
        End Property

        Public Shared Shadows ReadOnly Property DPT_Number As String
            Get
                Return "3.007"
            End Get
        End Property

        Public Overrides Function ToString() As String
            Return String.Format("Direction: {0}, StepCode: {1}", _direction, _stepCode)
        End Function

        Public Overrides Function ToObject() As Object()
            Return New Object() {_direction, _stepCode}
        End Function

        Public Overrides ReadOnly Property ObjectType As System.Type()
            Get
                Return New Type() {GetType(EIBDataDPT_3_007_Directions), GetType(Byte)}
            End Get
        End Property

        Public Overrides Function ToInfoList() As List(Of EIB.InfoBase)
            Dim list As New List(Of EIB.InfoBase)

            list.Add(New EIB.Info("Type", DPT_Name))
            list.Add(New EIB.Info("Direction", String.Format("{0} (0x{0:X})", _direction)))
            list.Add(New EIB.Info("StepCode", _stepCode))

            Return list
        End Function
    End Class
End Namespace